
Create your first Xcode command line project.

1.  Open Xcode and select to create a new project.
2.  Under the OSX tab on the left, select "Application." 
3.  Select the "Command Line Tool" template then click "Next."
4.  For the project type, select "Foundation," also select to use ARC.
5.  Give your project a name and save it where you want it.
6.  Click on "main.m" to see the default, "hello world" application.
7.  Notice the project build is set to "My Mac 64-bit" click on run.
8.  The output shows in the lower right-hand window on the botton of the Xcode window.
9.  If you can't see it, adjust the view setting in the upper right top of the window.

10. To comile on the command line open "Terminal" and execute:

    gcc –framework Foundation hello.m –o hello

    or (if you get strange foundation errors)

    clang -framework Foundation hello.m -o hello

11. Note: HelloWorld.m - does not use ARC - this is the old way. Hello uses ARC in Xcode.



 

